﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Data.SQLite;

namespace Web4.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class UserController : ControllerBase
    {
        OrderService orderService;
        [HttpGet]
        public Order idGetOrder(int id)
        {
            return orderService.id_getOrder(id);
        }
        public List<Order> GetOrders(string pro)
        {
            return orderService.pro_getOrders(pro);
        }
        public string addOrder(int id,string pro,string cus,double pri)
        {
            return orderService.addOrder(id, pro, cus, pri);
        }

        public string updateOrder(int id, string pro, string cus, double pri)
        {
            return orderService.updateOrder(id, pro, cus, pri);
        }

        public string deleteOrder(int id)
        {
            return orderService.deleteOrder(id);
        }
      
    }
}
